﻿--[[
    @brief  GameList sync control
    @author jameszhai
    @date   2017-03-23
]]

TGMListSyncCtrl = 
{
    InitCtrl = function()
        if TGMListSyncCtrl.bInited then
            return;
        end;

        -- 加载界面LUA
        ierd_tgp.tpf_ui.Require("game_list_sync\\view.lua");

        -- 初始化VIEW
        if TGMListSyncView.InitView() then
            TGPLog.LogE("GameListCtrl", "InitView fail.");
            TGMListSyncCtrl.bInited = true;
        end;

        comm_center.reg_service("Svr_ShowSyncTips",
            "TGMListSyncCtrl.OnShowSyncTips");
    end;

    UnInitCtrl = function()
        TGMListSyncView.UnInitView();
    end;

    -- 显示同步提示
    OnShowSyncTips = function(zParam)
        TGMListSyncView.SetClkSink("TGMListSyncCtrl.OnClkSyncBtn");
        TGMListSyncView.ShowTips(zParam["type"]);
    end;

    -- 点击确定按钮
    OnClkSyncBtn = function(nEnable)
        -- 关闭/开启
        local   zParam = {};

        zParam["enable"] = nEnable;

        comm_center.call_service("Svr_EnableCloudList", zParam);
    end;

    bInited  = false;

};

TGMListSyncCtrl.InitCtrl();